//
//  MPBluetoothManage.h
//  MPOSDemoProject
//
//  Created by lfy on 2018/6/6.
//  Copyright © 2018年 develop. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MPBlueToothDefine.h"
#import "MPBlueToothCallback.h"

@interface MPBluetoothManager : NSObject

/**
 SDK蓝牙管理实例

 @return MP蓝牙管理实例
 */
+ (instancetype)share;

/**
 设置蓝牙连接初始化参数

 @param type SDK蓝牙连接参数
 */
- (void)setupBlueToothManager:(BluetoothType)type;

/**
 开始扫描外设蓝牙
 */
- (void)startScan:(DiscoverToPeripheralsBlock)peripherals;

/**
 停止搜索蓝牙
 */
- (void)cancelScan;

/**
 连接蓝牙外设

 @param currPeripheral 蓝牙外设名称
 */
- (void)startConnect:(CBPeripheral*)currPeripheral handle:(ConnectPeripheralBlock)connected ;

/**
 断开连接蓝牙外设
 */
- (void)disConnect:(DisConnectPeripheralBlock)handle;


/**
 注册服务监听Block

 @param handle 发现新服务回调block
 */
- (void)registerDiscoverService:(DiscoverServerBlock)handle;

/**
 注册服务监听特征值

 @param handle 发现新的特征值回调
 */
- (void)registerDiscoverCharacteristic:(DiscoverCharacteristicBlock)handle;



/**
 像蓝牙写入内容

 @param writeStr 写入str
 */
- (void)writeToPeripheralWithString:(NSString*)writeStr;

/**
 获取蓝牙连接外设
 */
- (void)getConnectStatus;

@end

